import subprocess

if __name__ == '__main__':
    banned_list = ['distribute', 'pip', 'setuptools', 'wheel', 'twisted-iocpsupport', 'pywin32']

    subprocess.run('pip list --format=freeze > requirements.txt', shell=True)

    with open('requirements.txt', 'r') as file:
        lines = file.readlines()

    filtered_lines = [line for line in lines if not any(line.startswith(pkg) for pkg in banned_list)]

    with open('requirements.txt', 'w') as file:
        file.writelines(filtered_lines)